<!--
 * @Author: your name
 * @Date: 2020-11-17 15:52:25
 * @LastEditTime: 2020-11-18 18:37:04
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /vue-next/Users/duodian/Documents/qugame/work-admin/src/views/equip/modal.vue
-->
<template>
    <el-dialog
      :title="ruleForm.title"
      :visible.sync="visible"
      width="40%"
      :before-close="closeHandel"
    >
      <el-form
        :model="ruleForm"
        status-icon
        :rules="rules"
        ref="ruleForm"
        label-width="100px"
        class="demo-ruleForm"
      >
        <el-form-item label="分类名称" prop="name">
          <el-input
            type="text"
            v-model="ruleForm.name"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="所属分类" prop="checkPass">
          <el-cascader
            v-model="ruleForm.parentId"
            :options="selector"
            :props="defaultProps"
            @change="change"
            :show-all-levels="false"
            clearable
          ></el-cascader>
        </el-form-item>
        <el-form-item label="分类图片" prop="pic">
          <uploadOwnImg v-model="ruleForm.pic" width="140px" height="140px"/>
        </el-form-item>
        <el-form-item label="是否可合并">
          <el-radio-group v-model="ruleForm.merge">
            <el-radio  :label="1">是</el-radio>
            <el-radio  :label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeHandel">取 消</el-button>
        <el-button type="primary" @click="submitHandel">确 定</el-button>
      </span>
    </el-dialog>
</template>
<script>
export default {
  props: {
    visible: Boolean,
    ruleForm: {
      type: Object,
      default () {
        return {}
      }
    },
    selector: Array,
    defaultProps: {
      type: Object,
      default () {
        return {}
      }
    },
    closeHandel: Function,
    levelChange: Function,
    submitHandel: Function,
    change: Function,
    rules: Array
  }
}
</script>
